﻿1. changed build/core/combo/HOST_linux-x86.mk - changed _FORTIFY_SOURCE=0 build flag HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
ERROR:  :0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] 

FIX: 

in build/core/comboHOST_linux-x86.mk : 
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0 
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 

------- 


2. add #include <stddef.h> to external/mesa3d/src/glsl/linker.cpp




3. ERROR:  external/oprofile/libpp/format_output.h:94:22: error: 
reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive] 

FIX: 

in external/libpp/format_output.h b/libpp/format_output.h 
 -               mutable counts_t & counts; 
 +               counts_t & counts; 

------- 

4. 
ERROR:  external/gtest/include/gtest/internal/gtest-param- 
util.h:122:11: error: ‘ptrdiff_t’ does not name a type 

FIX: 

in external/gtest/include/gtest/internalgtest-param-util.h 
 #include <vector> 
+#include <cstddef> 
 #include <gtest/internal/gtest-port.h> 

------- 
5. 
diff --git a/lib/Support/Mutex.cpp b/lib/Support/Mutex.cpp 
index b408973..3a13adf 100644 
--- a/lib/Support/Mutex.cpp 
+++ b/lib/Support/Mutex.cpp 
@@ -13,6 +13,8 @@ 

 #include "llvm/Config/config.h" 
 #include "llvm/Support/Mutex.h" 
+#undef ENABLE_THREADS 
+#undef HAVE_PTHREAD_H 

-------
6.ERROR:  Numerous pthread errors w/llvm: 
      Example:   external/llvm/lib/Support/Threading.cpp:96: undefined 
reference to `pthread_create' 

diff --git a/lib/Support/Signals.cpp b/lib/Support/Signals.cpp 
index a117893..68fa5e7 100644 
--- a/lib/Support/Signals.cpp 
+++ b/lib/Support/Signals.cpp 
@@ -25,6 +25,8 @@ using namespace sys; 

 } 

+#undef HAVE_DLFCN_H 
+ 
 // Include the platform-specific parts of this class. 
 #ifdef LLVM_ON_UNIX 
 #include "Unix/Signals.inc" 
-------
7. ERROR:  Numerous pthread errors w/llvm: 
      Example:   external/llvm/lib/Support/Threading.cpp:96: undefined 
reference to `pthread_create' 

diff --git a/lib/Support/Threading.cpp b/lib/Support/Threading.cpp 
index 2957956..f1339a3 100644 
--- a/lib/Support/Threading.cpp 
+++ b/lib/Support/Threading.cpp 
@@ -16,6 +16,7 @@ 
 #include "llvm/Support/Mutex.h" 
 #include "llvm/Config/config.h" 
 #include <cassert> 
+#undef LLVM_MULTITHREADED 

 using namespace llvm;

------
8.
ERROR:  frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: 
error: variable ‘ParamName’ set but not used [-Werror=unused-but-set- 
variable] 

FIX: 

in android/ics/frameworks/compile/slang/Android.mk 
-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter 
-Werror 
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter 

------- 
-Werror issues:

host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1




host C++: libbccExecutionEngine <= frameworks/compile/libbcc/lib/ExecutionEngine/Compiler.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libbccExecutionEngine_intermediates/Compiler.o] Error 1

-	 changed libbcc/libbcc-config.mk 




host C++: libbcinfo <= frameworks/compile/libbcc/bcinfo/BitcodeTranslator.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libbcinfo_intermediates/BitcodeTranslator.o] Error 1


host C++: libRS <= frameworks/base/libs/rs/rsAdapter.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libRS_intermediates/rsAdapter.o] Error 1


host C++: libRS <= frameworks/base/libs/rs/rsAdapter.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libRS_intermediates/rsAdapter.o] Error 1



And for the pthread err

external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread -ldl


